<html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:py="http://genshi.edgewall.org/"
           xmlns:xi="http://www.w2.org/2001/XInclude"
           lang="en"
           py:strip="">
  <head py:match="head" py:attrs="select('@*')">
    <!-- Put any HEAD tags which all pages should have here. -->
    <link rel="stylesheet" type="text/css" media="screen" href="${g.home_href}blog_page.css"/>
    <link rel="stylesheet"  type="text/css" media="print" href="${g.home_href}blog_page_print.css" />
    <title> $g.blog_title</title>
    <meta py:replace="select('*|text()')" />
  </head>
  
  <!--! MACROS -->
  
  <span py:def="breadcrumbs(path)">
            <?python
            parts=path.split('/')
            breadcrumbs=[]
            url=g.home_href.strip('/')
            for p in parts[0:-1]: 
                url+='/%s'%p
                breadcrumbs.append((url,p))
            breadcrumbs=breadcrumbs[1:] # hack
            ?>
            <a py:for="b in breadcrumbs" href="${b[0]}">/${b[1]}</a>
        </span>
        
        
   <span py:def="categories(cats,colon='')">
        $colon Categories <span py:for="cat in cats"><a href="${g.home_href+cat}">$cat</a> </span>
   </span>
    
  <!--! MACROS END -->
  
  <body py:match="body" py:attrs="select('@*')">
    <!-- Put anything that should appear before the page content here (e.g., logo, menu, left sidebar) -->
    <div id="top">
        <h1>$g.site_title</h1>
        <h2>$g.site_sub_title</h2>
    </div>
        <div id="menu">
            ${Markup(c.menu)}
            <div class="sysMenu">
                <p py:for="e in c.sysMenu"><a href="${c.sysMenu[e]}">$e</a></p>
            </div>
        </div>    
        <div id="main">
        <div id="messageBar">
            <p py:if="c.action">$c.action <a py:if="c.actionURL" href="$c.actionURL">CONFIRM</a></p>
        </div>
        <!-- This is the page content -->
        <div py:replace="select('*|text()')">This page has no content.</div>
        </div>
    
    <!-- Put anything that should appear after the page content here (e.g., page footer, copyright, "Contact Us" link). -->
    <div id="bottom">
        $g.footer_text
    </div>
  </body>
</html>

